Changeset 7419 introduced a check for DOM0 before setting a bit in the
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 1 Nov 2005 23:08:01 +0000 (00:08 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 1 Nov 2005 23:08:01 +0000 (00:08 +0100)
cpu_present map.  This prevents domU SMP kernels without HOTPLUG_CPU
support from booting.  Secondary cpus need to be present and online
before init/main.c:do_basic_setup() calls init_workqueues() (which
initializes per-cpu workqueues).

Without this patch, non HOTPLUG_CPU enabled kernels hang when flushing
cpu workqueues as the spinlock in the structure is never initialized (it
has a default value of zero which means the lock has been acquired on
x86).

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c

index 6e15afb0087945913602bc4af29c4a5bc692227e..be1384679d88f6214930237f256a0afcba9d9aeb 100644 (file)
@@ -236,8 +236,12 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
                make_page_readonly((void *)cpu_gdt_descr[cpu].address);
 
                cpu_set(cpu, cpu_possible_map);
+#ifdef CONFIG_HOTPLUG_CPU
                if (xen_start_info->flags & SIF_INITDOMAIN)
                        cpu_set(cpu, cpu_present_map);
+#else
+               cpu_set(cpu, cpu_present_map);
+#endif
 
                vcpu_prepare(cpu);
        }
@@ -265,6 +269,8 @@ void __devinit smp_prepare_boot_cpu(void)
        cpu_online_map   = cpumask_of_cpu(0);
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+
 static void vcpu_hotplug(unsigned int cpu)
 {
        int err;
@@ -284,11 +290,7 @@ static void vcpu_hotplug(unsigned int cpu)
                cpu_set(cpu, cpu_present_map);
                (void)cpu_up(cpu);
        } else if (strcmp(state, "offline") == 0) {
-#ifdef CONFIG_HOTPLUG_CPU
                (void)cpu_down(cpu);
-#else
-               printk(KERN_INFO "Ignoring CPU%d hotplug request\n", cpu);
-#endif
        } else {
                printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d\n",
                       state, cpu);
@@ -338,8 +340,6 @@ static int __init setup_vcpu_hotplug_event(void)
 
 subsys_initcall(setup_vcpu_hotplug_event);
 
-#ifdef CONFIG_HOTPLUG_CPU
-
 int __cpu_disable(void)
 {
        cpumask_t map = cpu_online_map;